const express = require('express');

const app = express();

app.use((requset, response, next)=>{
    response.set('Access-Control-Allow-Origin','*');
    response.set('Access-Control-Allow-Headers','*');
    next();
})
app.get('/server',(request,response)=>{
    response.send('ajax server');
})

app.get('/timeout', (request, response)=>{
    setTimeout(()=>{
        response.send('time out 4s')
    },3000);
})

app.listen(8080,()=>{
    console.log('server run at 8080');
})